<?php
include ('../practice/includes/db.php');
pr($_GET);

$userResource = fetchAll('user_images'," WHERE `id`=$_GET[id]");
$user = mysql_fetch_assoc($userResource);

$isActive  = ($user['status']==1)?'checked':'';
$isInactive  = ($user['status']==0)?'checked':'';
//pr($user);
?>
<link href="../practice/css/form.css" rel="stylesheet" type="text/css" />

<form action="upload_edit_image.php" method="post" enctype="multipart/form-data">

<input type="hidden1" name="id" value="<?=$user['id']?>" />
<input type="hidden1" name="current_avatar" value="<?=$user['avatar']?>" />

  <table border="1" cellpadding="0" cellspacing="0" width="80%" align="center">
    <thead>
      <tr>
        <th colspan="2">Please fill the details </th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td align="right" style="font-weight:bold;">Title :</td>
        <td ><input type="text" required name="title" value="<?=$user['title']?>" /></td>
      </tr>

      <tr>
        <td align="right" style="font-weight:bold;">Avatar :</td>
        <td ><a target="_blank" href="uploads/<?=$user['avatar']?>"><img src="uploads/wall/<?=$user['avatar']?>"></a>
<input type="file" name="avatar" />

        </td>
      </tr>

      <tr>
        <td align="right" style="font-weight:bold;">Status :</td>
        <td >
<label><input <?=$isActive?> name="status" type="radio" value="1" />Active</label>
<label><input <?=$isInactive?> name="status" type="radio" value="0" />Inactive</label>
        </td>
      </tr>

      <tr>
        <td align="right" style="font-weight:bold;">&nbsp;</td>
        <td ><input type="submit" value="Update Me!!" name="submit" /></td>
      </tr>


    </tbody>
  </table>
</form>
